<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>Bootstrap Dashboard</title>
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta name="robots" content="all,follow">
		<!-- Bootstrap CSS-->
		<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.min.css">
		<!-- Font Awesome CSS-->
		<link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css">
		<!-- Fontastic Custom icon font-->
		<link rel="stylesheet" href="css/fontastic.css">
		<!-- Google fonts - Roboto -->
		<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700">
		<!-- jQuery Circle-->
		<link rel="stylesheet" href="css/grasp_mobile_progress_circle-1.0.0.min.css">
		<!-- Custom Scrollbar-->
		<link rel="stylesheet" href="vendor/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css">
		<!-- theme stylesheet-->
		<link rel="stylesheet" href="css/style.default.css" id="theme-stylesheet">
		<!-- Custom stylesheet - for your changes-->
		<link rel="stylesheet" href="css/custom.css">
		<!-- Favicon-->
		<link rel="shortcut icon" href="img/favicon.ico">
		<!-- Tweaks for older IEs-->
		<!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]-->
	</head>
	<body>
		<div class="page login-page">
			<div class="container">
				<div class="form-outer text-center d-flex align-items-center">
					<div class="form-inner">
						<div class="logo text-uppercase"><span>Bootstrap</span><strong class="text-primary">Dashboard</strong></div>
						<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore
							magna aliqua. Ut enim ad minim veniam, quis nostrud.</p>
						<form method="get" class="text-left form-validate">
							<div class="form-group-material">
								<input id="user" type="text" name="loginUsername" required data-msg="Please enter your username" class="input-material">
								<label for="login-username" class="label-material">Username</label>
							</div>
							<div class="form-group-material">
								<input id="pwd" type="password" name="loginPassword" required data-msg="Please enter your password" class="input-material">
								<label for="login-password" class="label-material">Password</label>
							</div>
							<div class="form-group text-center">
								<input type="button" value="用户登录" onclick="login()" class="btn btn-primary" />
								<!-- <input type="button" value="管理员登录" onclick="adminlogin()" class="btn btn-primary" /> -->
							</div>
						</form>
					</div>
					<div class="copyrights text-center">


					</div>
				</div>
			</div>
		</div>
		<!-- JavaScript files-->
		<script src="vendor/jquery/jquery.min.js"></script>
		<script src="vendor/popper.js/umd/popper.min.js"> </script>
		<script src="vendor/bootstrap/js/bootstrap.min.js"></script>
		<script src="js/grasp_mobile_progress_circle-1.0.0.min.js"></script>
		<script src="vendor/jquery.cookie/jquery.cookie.js"> </script>
		<script src="vendor/chart.js/Chart.min.js"></script>
		<script src="vendor/jquery-validation/jquery.validate.min.js"></script>
		<script src="vendor/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"></script>
		<!-- Main File-->
		<script src="js/front.js"></script>
	</body>
	<script type="text/javascript">
		//用户登录
		function login() {
			var username = $("#user").val();
			var userpwd = $("#pwd").val();
			// alert(username+" "+userpwd)
			$.ajax({
				// type: "POST",
				url: "http://localhost:8080/user/login/" + username + "/" + userpwd,
				data: {

				},
				// dataType: json,
				success: function(result) {
					console.log(result.status);
					if (result.status == 200) {
						alert(result.msg)
						window.location = "http://localhost:8080/cadiEditSoftware/index.html"
					} else {
						alert(result.msg)
					}
				},
				error: function() {
					alert("服务器异常")
				}

			})
		}
		//管理员登录
		function adminlogin() {
			var username = $("#user").val();
			var userpwd = $("#pwd").val();
			// alert(username+" "+userpwd)
			$.ajax({
				// type: "POST",
				url: "http://localhost:8080/user/adminlogin/" + username + "/" + userpwd,
				// dataType: json,
				success: function(result) {
					console.log(result.status);
					if (result.status == 200) {
						alert(result.msg)
						window.location = "http://localhost:8080/cadiEditSoftware/admin.html"
					} else {
						alert(result.msg)
					}
				},
				error: function() {
					alert("服务器异常")
				}

			})
		}
	</script>
</html>
